package com.atguigu.springboot.BeanPostProcessor;

import org.springframework.beans.BeansException;
import org.springframework.beans.factory.config.BeanPostProcessor;
import org.springframework.stereotype.Component;

@Component
public class BeanPostProcessorDemo implements BeanPostProcessor {
    @Override
    public Object postProcessBeforeInitialization(Object o, String s) throws BeansException {
        if(s.equals("applicationContextAwareDemo")){
            System.out.println("BeanPostProcessor执行postProcessBeforeInitialization");
        }
        return o;
    }

    @Override
    public Object postProcessAfterInitialization(Object o, String s) throws BeansException {
        if(s.equals("applicationContextAwareDemo")){
            System.out.println("BeanPostProcessor执行postProcessAfterInitialization");
        }
        return o;
    }
}
